package main

import "fmt"

func main() {
	da(Dog{})
}

type Cat struct {
}

type Dog struct {
}

func (d Dog) speak() {
	fmt.Println("学狗叫")
}

func (d Cat) speak() {
	fmt.Println("学猫叫")
}

type Animal interface {
	speak()
}

func da(x Animal) {
	x.speak()
}
